package com.deke.home.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.deke.entity.AclPermission;
import com.deke.entity.CrmBanner;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ：ludi
 * @date ：Created in 2022/12/6 18:50
 * @description：轮播管理
 * @modified By：
 * @version:
 */
public interface CrmBannerDao extends BaseMapper<CrmBanner> {

    /**
     * 根据用户id查询权限值
     */
    @Select("select p.permission_value from acl_permission p join acl_role_permission rp on p.id = rp.permission_id join acl_user_role ur on ur.role_id = rp.role_id join acl_user on ur.user_id=acl_user.id where acl_user.username = #{username};")
    List<AclPermission> findPermissionByUserName(String username);

}